var mongoose = require('../common/db');

var article = new mongoose.Schema({
    articleTitle: String,
    articleContent: String,
    articleTime: String
})
//通过id查找
article.statics.findByArticleId = function (id) {
    return this.find({ _id: id }).exec();
};

article.statics.findAll = async function () {
    return await this.find({});
};

var articleModel = mongoose.model('article', article);
module.exports = articleModel;